﻿Public Class DrillDown

    Private Sub ChaBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
        Me.Validate()
        Me.ChaBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.PCV_TutorialDataSet)

    End Sub

    Private Sub DrillDown_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PCV_TutorialDataSet.Cha' table. You can move, or remove it, as needed.
        Me.ChaTableAdapter.Fill(Me.PCV_TutorialDataSet.Cha)

    End Sub

    Private Sub MaITextEdit_EditValueChanged(sender As Object, e As EventArgs) Handles MaITextEdit.EditValueChanged

    End Sub

    Private Sub NhapTroVeDuLieuGocToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NhapTroVeDuLieuGocToolStripMenuItem.Click
        DrillDown()
    End Sub
    Private Sub DrillDown()
        Try
            Dim ma As String = Me.IGridView1.GetFocusedRowCellValue("ma")
            If ma.Substring(0, 3) = "233" Then
                DMCha.setMa(ma)
                DMCha.Show()
                DMCha.MdiParent = Me.MdiParent
                DMCha.WindowState = FormWindowState.Maximized
            Else
                DevExpress.XtraEditors.XtraMessageBox.Show("Không có dữ liệu gốc !!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)
            End If
        Catch ex As Exception
            DevExpress.XtraEditors.XtraMessageBox.Show("Không có dữ liệu gốc !!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End Try
    End Sub

End Class
